package com.yequan.rocketmq.order;

import com.yequan.rocketmq.service.impl.RocketMQConsumer;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author yq
 * @date 2020/09/10
 */
public class OrderConsumerTest {

    private ApplicationContext context;

    @Before
    public void init() {
        context = new ClassPathXmlApplicationContext("classpath:spring-orderconsumer.xml");
    }

    @Test
    public void consumeMessage1() throws InterruptedException {
        OrderConsumer consumer = context.getBean(OrderConsumer.class);
        Thread.sleep(200000);
        consumer.destroy();
    }

    @Test
    public void consumeMessage2() throws InterruptedException {
        OrderConsumer consumer = context.getBean(OrderConsumer.class);
        Thread.sleep(200000);
        consumer.destroy();
    }

    @Test
    public void consumeMessage3() throws InterruptedException {
        OrderConsumer consumer = context.getBean(OrderConsumer.class);
        Thread.sleep(200000);
        consumer.destroy();
    }
}
